home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / hardware / galer21.lha / GALer21 / Source / GALer / Localize.c < prev    next >
C/C++ Source or Header  |  1996-04-05  |  7KB  |  227 lines

  1. /******************************************************************************
  2. ** Localize.c
  3. *******************************************************************************
  4. **
  5. ** description:
  6. **
  7. ** This file contains functions to localize GALer.
  8. **
  9. ******************************************************************************/
  10.  
  11.  
  12.  
  13.  
  14.  
  15. /********************************* includes **********************************/
  16.  
  17. #include <exec/types.h>
  18. #include <graphics/displayinfo.h>
  19. #include <libraries/gadtools.h>
  20. #include <libraries/locale.h>
  21. #include <string.h>
  22.  
  23. #include <proto/locale.h>
  24.  
  25. #include "Localize.h"
  26.  
  27.  
  28.  
  29.  
  30.  
  31. /********************************** defines **********************************/
  32.  
  33.  
  34.  
  35.  
  36.  
  37. /******************************** functions **********************************/
  38.  
  39.  
  40.  
  41.  
  42.  
  43. /******************************** variables **********************************/
  44.  
  45. extern  struct  AppString { LONG   as_ID;
  46.                             STRPTR as_Str;
  47.                           };
  48.  
  49. extern  struct  AppString AppStrings[];
  50.  
  51. extern  struct  Catalog    *catalog;
  52. extern  struct  Library    *LocaleBase;
  53.  
  54. extern  struct  NewMenu   MainMenu[];
  55. extern  struct  NewMenu   CheckerMenu[];
  56.  
  57.  
  58. extern  UBYTE   *CmpText1, *CmpText2, *CmpText3, *CmpText4;
  59. extern  UBYTE   OptTxt1[];
  60. extern  UBYTE   ErrorLineStr[];
  61.  
  62. extern  char    *cmps[4];
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. /******************************************************************************
  71. ** LocalizeText()
  72. *******************************************************************************
  73. ** input:   none
  74. ** output:  none
  75. **
  76. ** remarks: localize text
  77. ******************************************************************************/
  78.  
  79. void LocalizeText(void)
  80. {
  81.     int n;
  82.  
  83.     if (LocaleBase && catalog)
  84.     {
  85.         for (n = 0; n <= LAST_LOCALISATION_STR; n++)
  86.             AppStrings[n].as_Str = GetCatalogStr(catalog, n,
  87.                                                  AppStrings[n].as_Str);
  88.     }   
  89.  
  90.  
  91.     /************************* localize menus ***************************/
  92.         /* Project menu */
  93.     MainMenu[ 0].nm_Label   = AppStrings[MSG_MAIN_MENU1].as_Str;
  94.  
  95.     MainMenu[ 1].nm_Label   = AppStrings[MSG_MAIN_MENU1_ITEM1].as_Str;
  96.  
  97.     MainMenu[ 2].nm_Label   = AppStrings[MSG_MAIN_MENU1_ITEM2].as_Str;
  98.  
  99.     MainMenu[ 6].nm_Label   = AppStrings[MSG_MAIN_MENU1_ITEM3].as_Str;
  100.  
  101.     MainMenu[ 8].nm_Label   = AppStrings[MSG_MAIN_MENU1_ITEM5].as_Str;
  102.     MainMenu[ 8].nm_CommKey = AppStrings[MSG_MAIN_MENU1_ITEM5_COMMKEY].as_Str;
  103.  
  104.  
  105.  
  106.         /* GAL-Type menu */
  107.     MainMenu[ 9].nm_Label   = AppStrings[MSG_MAIN_MENU2].as_Str;
  108.  
  109.     MainMenu[10].nm_Label   = AppStrings[MSG_MAIN_MENU2_ITEM1].as_Str;
  110.     MainMenu[10].nm_CommKey = AppStrings[MSG_MAIN_MENU2_ITEM1_COMMKEY].as_Str;
  111.  
  112.     MainMenu[11].nm_Label   = AppStrings[MSG_MAIN_MENU2_ITEM2].as_Str;
  113.     MainMenu[11].nm_CommKey = AppStrings[MSG_MAIN_MENU2_ITEM2_COMMKEY].as_Str;
  114.  
  115.     MainMenu[12].nm_Label   = AppStrings[MSG_MAIN_MENU2_ITEM3].as_Str;
  116.     MainMenu[12].nm_CommKey = AppStrings[MSG_MAIN_MENU2_ITEM3_COMMKEY].as_Str;
  117.  
  118.     MainMenu[13].nm_Label   = AppStrings[MSG_MAIN_MENU2_ITEM4].as_Str;
  119.     MainMenu[13].nm_CommKey = AppStrings[MSG_MAIN_MENU2_ITEM4_COMMKEY].as_Str;
  120.  
  121.     MainMenu[15].nm_Label   = AppStrings[MSG_MAIN_MENU2_ITEM6].as_Str;
  122.  
  123.  
  124.  
  125.         /* GAL menu */
  126.     MainMenu[16].nm_Label   = AppStrings[MSG_MAIN_MENU3].as_Str;
  127.  
  128.     MainMenu[17].nm_Label   = AppStrings[MSG_MAIN_MENU3_ITEM1].as_Str;
  129.     MainMenu[17].nm_CommKey = AppStrings[MSG_MAIN_MENU3_ITEM1_COMMKEY].as_Str;
  130.  
  131.     MainMenu[18].nm_Label   = AppStrings[MSG_MAIN_MENU3_ITEM2].as_Str;
  132.  
  133.     MainMenu[19].nm_Label   = AppStrings[MSG_MAIN_MENU3_ITEM3].as_Str;
  134.  
  135.     MainMenu[20].nm_Label   = AppStrings[MSG_MAIN_MENU3_ITEM4].as_Str;
  136.  
  137.     MainMenu[21].nm_Label   = AppStrings[MSG_MAIN_MENU3_ITEM5].as_Str;
  138.     MainMenu[21].nm_CommKey = AppStrings[MSG_MAIN_MENU3_ITEM5_COMMKEY].as_Str;
  139.  
  140.     MainMenu[22].nm_Label   = AppStrings[MSG_MAIN_MENU3_ITEM6].as_Str;
  141.  
  142.     MainMenu[23].nm_Label   = AppStrings[MSG_MAIN_MENU3_ITEM7].as_Str;
  143.  
  144.     MainMenu[25].nm_Label   = AppStrings[MSG_MAIN_MENU3_ITEM9].as_Str;
  145.  
  146.  
  147.  
  148.         /* GAL-Assembler menu */
  149.     MainMenu[26].nm_Label   = AppStrings[MSG_MAIN_MENU4].as_Str;
  150.  
  151.     MainMenu[27].nm_Label   = AppStrings[MSG_MAIN_MENU4_ITEM1].as_Str;
  152.     MainMenu[27].nm_CommKey = AppStrings[MSG_MAIN_MENU4_ITEM1_COMMKEY].as_Str;
  153.  
  154.  
  155.  
  156.         /* GAL-Disassembler */
  157.     MainMenu[28].nm_Label   = AppStrings[MSG_MAIN_MENU5].as_Str;
  158.  
  159.     MainMenu[29].nm_Label   = AppStrings[MSG_MAIN_MENU5_ITEM1].as_Str;
  160.  
  161.     MainMenu[30].nm_Label   = AppStrings[MSG_MAIN_MENU5_ITEM2].as_Str;
  162.  
  163.     MainMenu[31].nm_Label   = AppStrings[MSG_MAIN_MENU5_ITEM3].as_Str;
  164.     MainMenu[31].nm_CommKey = AppStrings[MSG_MAIN_MENU5_ITEM3_COMMKEY].as_Str;
  165.  
  166.     MainMenu[33].nm_Label   = AppStrings[MSG_MAIN_MENU5_ITEM5].as_Str;
  167.     MainMenu[33].nm_CommKey = AppStrings[MSG_MAIN_MENU5_ITEM5_COMMKEY].as_Str;
  168.  
  169.     MainMenu[34].nm_Label   = AppStrings[MSG_MAIN_MENU5_ITEM6].as_Str;
  170.  
  171.     MainMenu[36].nm_Label   = AppStrings[MSG_MAIN_MENU5_ITEM8].as_Str;
  172.     MainMenu[36].nm_CommKey = AppStrings[MSG_MAIN_MENU5_ITEM8_COMMKEY].as_Str;
  173.  
  174.  
  175.  
  176.         /* Tools menu */
  177.     MainMenu[37].nm_Label   = AppStrings[MSG_MAIN_MENU6].as_Str;
  178.  
  179.     MainMenu[38].nm_Label   = AppStrings[MSG_MAIN_MENU6_ITEM1].as_Str;
  180.  
  181.     MainMenu[39].nm_Label   = AppStrings[MSG_MAIN_MENU6_ITEM2].as_Str;
  182.  
  183.     MainMenu[40].nm_Label   = AppStrings[MSG_MAIN_MENU6_ITEM3].as_Str;
  184.     MainMenu[40].nm_CommKey = AppStrings[MSG_MAIN_MENU6_ITEM3_COMMKEY].as_Str;
  185.  
  186.     MainMenu[42].nm_Label   = AppStrings[MSG_MAIN_MENU6_ITEM5].as_Str;
  187.     MainMenu[42].nm_CommKey = AppStrings[MSG_MAIN_MENU6_ITEM5_COMMKEY].as_Str;
  188.  
  189.     MainMenu[44].nm_Label   = AppStrings[MSG_MAIN_MENU6_ITEM7].as_Str;
  190.  
  191.     MainMenu[45].nm_Label   = AppStrings[MSG_MAIN_MENU6_ITEM8].as_Str;
  192.     MainMenu[45].nm_CommKey = AppStrings[MSG_MAIN_MENU6_ITEM8_COMMKEY].as_Str;
  193.  
  194.     MainMenu[47].nm_Label   = AppStrings[MSG_MAIN_MENU6_ITEM10].as_Str;
  195.  
  196.  
  197.  
  198.  
  199.  
  200.     /************************* localize gadgets ***************************/
  201.  
  202.     cmps[0] = AppStrings[MSG_CMP_GALGAL2].as_Str;     /* comparison ratio */
  203.     cmps[1] = AppStrings[MSG_CMP_GALJED2].as_Str;     /* buttons          */
  204.     cmps[2] = AppStrings[MSG_CMP_JEDGAL2].as_Str;
  205.     cmps[3] = NULL;
  206.  
  207.  
  208.  
  209.  
  210.     /***************** localize text pointers and strings *****************/
  211.  
  212.  
  213.     CmpText4 = (UBYTE *)AppStrings[MSG_CMP_CANCEL].as_Str;
  214.  
  215.     CmpText3 = (UBYTE *)AppStrings[MSG_CMP_SIGEQUAL].as_Str;
  216.  
  217.     CmpText2 = (UBYTE *)AppStrings[MSG_CMP_NOTEQUAL].as_Str;
  218.  
  219.     CmpText1 = (UBYTE *)AppStrings[MSG_CMP_EQUAL].as_Str;
  220.  
  221.  
  222.     strcpy(ErrorLineStr, AppStrings[MSG_ERRLINE].as_Str);
  223.  
  224. }
  225.  
  226.  
  227.